using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;

public class BasePanel : MonoBehaviour
{
    protected bool isRemove = false;
    protected new string name;
    public Vector3 startScale = new Vector3(0,0,0);
    public float duration = 1f;
    public Ease easeType = Ease.OutQuad;

    public virtual void SetActive(bool active)
    {
        gameObject.SetActive(active);
    }

    public virtual void OpenPanel(string name,params object[] args)
    {
        this.name = name;
        SetActive(true);
        // transform.localScale = startScale;
        // transform.DOScale(Vector3.one, duration)
        //     .SetEase(easeType);
    }

    public virtual void ClosePanel()
    {
        isRemove = true;
        SetActive(false);
        Destroy(gameObject);
        if (UIManager.Instance.panelDict.ContainsKey(name))
        {
            UIManager.Instance.panelDict.Remove(name);
        }
    }
}
